
import type{ StateCreator } from 'zustand'; // 1. 导入类型
import type{ counterStoreType } from '@/utils/type';





export const counterStore: StateCreator<counterStoreType> = (set) => ({
  count: 1,
  increment: () => set((state) => ({ count: state.count + 1 })),
  decrement: () => set((state) => ({ count: state.count - 1 })),
  setCount: (count) => set(() => ({ count }))
});